home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-comexc.adb < prev    next >
Text File  |  1996-01-30  |  4KB  |  104 lines

  1. -----------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --            S Y S T E M . C O M P I L E R _ E X C E P T I O N S           --
  6. --                                                                          --
  7. --                                  B o d y                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.10 $                             --
  10. --                                                                          --
  11. --       Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved        --
  12. --                                                                          --
  13. -- GNARL is free software; you can redistribute it  and/or modify it  under --
  14. -- terms  of  the  GNU  Library General Public License  as published by the --
  15. -- Free Software  Foundation;  either version 2, or (at  your  option)  any --
  16. -- later  version.  GNARL is distributed  in the hope that  it will be use- --
  17. -- ful, but but WITHOUT ANY WARRANTY;  without even the implied warranty of --
  18. -- MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. -- eral Library Public License  for more details.  You should have received --
  20. -- a  copy of the GNU Library General Public License along with GNARL;  see --
  21. -- file COPYING.LIB.  If not,  write to the  Free Software Foundation,  675 --
  22. -- Mass Ave, Cambridge, MA 02139, USA.                                      --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Error_Reporting;
  27. --  Used for,  Error_Reporting.Unimplemented_Operation
  28. --             Error_Reporting.Assert
  29.  
  30. with System.Task_Primitives;
  31. --  Used for,  Task_Primitives.Machine_Exceptions;
  32. --             Task_Primitives.Error_Information;
  33.  
  34. package body System.Compiler_Exceptions is
  35.  
  36.    procedure Unimplemented renames
  37.       System.Error_Reporting.Unimplemented_Operation;
  38.  
  39.    ---------------------
  40.    -- Raise_Exception --
  41.    ---------------------
  42.  
  43.    --  This is a stopgap implementation which can only raise predefined
  44.    --  exceptions.
  45.  
  46.    procedure Raise_Exception (E : Exception_ID) is
  47.    begin
  48.       case E is
  49.       when Null_Exception =>
  50.          null;
  51.       when Constraint_Error_ID =>
  52.          raise Constraint_Error;
  53.       when Numeric_Error_ID =>
  54.          raise Numeric_Error;
  55.       when Program_Error_ID =>
  56.          raise Program_Error;
  57.       when Storage_Error_ID =>
  58.          raise Storage_Error;
  59.       when Tasking_Error_ID =>
  60.          raise Tasking_Error;
  61.       when others =>
  62.          Unimplemented;
  63.       end case;
  64.    end Raise_Exception;
  65.  
  66.    ----------------------
  67.    -- Notify_Exception --
  68.    ----------------------
  69.  
  70.  
  71.    procedure Notify_Exception
  72.      (Which              : Task_Primitives.Machine_Exceptions;
  73.       Info               :  Task_Primitives.Error_Information;
  74.       Modified_Registers : Pre_Call_State)
  75.    is
  76.    begin
  77.       Unimplemented;
  78.    end Notify_Exception;
  79.  
  80.    -----------------------
  81.    -- Current_Exception --
  82.    -----------------------
  83.  
  84.    function Current_Exception return Exception_ID is
  85.    begin
  86.       Unimplemented;
  87.       return Null_Exception;
  88.    end Current_Exception;
  89.  
  90.    -----------
  91.    -- Image --
  92.    -----------
  93.  
  94.    function Image
  95.      (E    : Exception_ID)
  96.       return Exception_ID_String
  97.    is
  98.    begin
  99.       Unimplemented;
  100.       return "Not Implemented*";
  101.    end Image;
  102.  
  103. end System.Compiler_Exceptions;
  104.